using System;

namespace Subsync
{
	/// <summary>
	/// Author: Steven Goh Jian Wen
	/// </summary>
	public class Tools
	{
		public static string RandomStr()
		{
			Random random_obj = new Random();
			string name = "";
			for (int x = 0; x < 10; x++) {
				//10 characters file/foldername
				int string_or_int = random_obj.Next(1);
				if (string_or_int == 0) {
					//string
					char ascii_char = (char)random_obj.Next (97, 122);
					name += ascii_char;
				}
                else {
					//integer
					int random_integer = random_obj.Next (9);
					name += random_integer.ToString ();
				}
			}
			return name;
		}
		
		public static string BoolToYesNo (bool boo)
		{
			if (boo)
				return "yes";
            else
                return "no";
		}
		
		public static bool StringToBool (string str)
		{
			if (str == "yes")
				return true;
            else
                return false;
		}
	}
}
